package com.invengo.library_rfid;

import android.app.Application;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

import com.invengo.device.DeviceHelper;

import me.goldze.mvvmhabit.utils.KLog;

public class RFIDProcessObserver implements LifecycleObserver {
    static final String TAG = RFIDProcessObserver.class.getSimpleName();

    private Application application;

    public RFIDProcessObserver(Application application) {
        this.application = application;
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    public void onCreate() {
        DeviceHelper.getInstance().init(application);
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    public void onPause() {
        KLog.e("onpause");
        DeviceHelper.getInstance().stopScan();
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    public void onStop() {
//        DeviceHelper.getInstance().closeDevice();
    }

    public static final String ACTION_CUSTOM_BLUETOOTH_BROADCAST = "com.invengo.rfidpad.base.CUSTOM_BLUETOOTH_BROADCAST";


}
